/**
 * ajax的全局设置
 */
$.ajaxSetup({
	  //error :  function(){
		//  bootbox.alert("系统发生异常,请重新操作!");
	  //}
	type: 'POST',
	complete: function(xhr,status) {
		var sessionStatus = xhr.getResponseHeader('sessionStatus');
		if(sessionStatus == 'timeout') {
			var top = getTopWinow();
			var yes = confirm('由于您长时间没有操作, session已过期, 请重新登录.');
			if (yes) {
				top.location.href = getpn();
			}
		}
	}
});
function getTopWinow(){
	var p = window;
	 while(p != p.parent){
		 p = p.parent;
	 }
	 return p;
}
//获取项目主页的请求路径
function getpn(){
	var pathname = location.pathname;
	pathname = pathname.substring(1);
	pathname = pathname.substring(0,pathname.indexOf("/")+1);
	return "http://"+location.host+"/"+pathname;	//http://127.0.0.1:8080/springMVC_interceptor/
}